#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QDomDocument>
#include <QLabel>
#include "widgetabout.h"

namespace Ui
{
    class MainWindow;
}

namespace sk
{
    class GameModel;
    class GameLevel;
    class GameProject;
    class GameItem;
    class LevelItem;
}

class QPainter;
class QDockWidget;

class ProjectExplorer;
class LevelEditor;
class WidgetAbout;

#define GEOMETRY_VERSION 2

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    sk::GameProject * project();

    void onLevelDoubleClicked(sk::LevelItem * item);
    sk::GameModel * model();

public slots:
    void closeProject(bool save);
private:
    Ui::MainWindow *ui;

private slots:
    void on_actionDelete_triggered();
    void on_actionDuplicate_triggered();
    void on_actionClose_triggered();
    void on_actionOpen_triggered();
    void on_actionSave_triggered();
    void on_actionNewLevel_triggered();
    void on_actionAbout_triggered();
    void on_actionNew_triggered();

private:
    sk::GameProject * _project;

    ProjectExplorer * _projectExplorer;
    QDockWidget     * _dwProjectExplorer;

    LevelEditor     * _levelEditor;
    //QDockWidget     * _dwLevelEditor;
    WidgetAbout     * widAbout;

    sk::GameModel * _model;

protected:
    void closeEvent(QCloseEvent *);

private:
    void _newProjectLoaded();
    void _closeProjectCheckSave();
    void _saveGeometry();
    void _loadGeometry();
};

#endif // MAINWINDOW_H
